package tue.cse.advanceddatabases.project.xml.artist;

import java.util.List;
import java.util.Vector;
import java.util.logging.Logger;

import org.dom4j.Element;

public class ArtistsParser {
	private static Logger logger = Logger.getLogger(ArtistsParser.class.getName());
	
	public static List<Artist> parse(List<Element> artistsElement) {
		return parse(artistsElement.get(0));
	}
	
	public static List<Artist> parse(Element artistsElement) {
		List<Artist> artists = new Vector<Artist>();
		
		List<Element> artistElements = artistsElement.elements();
		
		logger.info("Number of Artists are:" + artistElements.size());
		for (int i=0; i< artistElements.size();i++){
			Element element = artistElements.get(i);
			artists.add(new Artist(element));
		}
		return artists;
	}

}